<template>
  <div>
    <el-row>
      <el-col :span="10" :offset="7" style="margin-top:30px">
        <el-form ref="form" label-width="120px">
          <el-form-item v-permission="['admin']" label="品牌选择">
            <brand-select :is-disable="isDisable" :val-prop="brand_id" @changeVal="brandChange" />
          </el-form-item>
          <el-form-item label="管理员密码">
            <el-input v-model="password" :disabled="isDisable" type="password" />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" :disabled="isDisable" @click="onSubmit">提交</el-button>
            <el-button @click="setFun">设置</el-button>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>

  </div>
</template>

<script>
import brandSelect from '@/components/BrandSelect'
import permission from '@/directive/permission'
export default {
  directives: {
    permission
  },
  components: {
    brandSelect
  },
  data() {
    return {
      brand_id: this.$store.getters.brand_id,
      password: '',
      isDisable: true
    }
  },
  methods: {
    setFun() {
      this.isDisable = false
    },
    onSubmit() {
      console.log('submit')
    },
    brandChange(val) {
      this.brand_id = val
    }
  }
}
</script>

<style lang="sass" scoped>

</style>
